package com.showde.shoppingmall.business.logic;

import org.json.JSONObject;

import android.util.Log;

import com.kim.net.NetEntity;
import com.showde.shoppingmall.business.NetCallbackImplBase.Notify;
import com.showde.shoppingmall.business.RegisterBusiness;

public class RegisterLogic {
	
	private static final String TAG = "RegisterLogic";

	public static void register(String userAccount, String password,
			final UICallbackInterface uiCallbackInterface) {

		RegisterBusiness registerBusiness = new RegisterBusiness(userAccount,
				password, new Notify() {

					@Override
					public void notifyNetCallback(NetEntity netEntity) {
						JSONObject jsonObject = netEntity.result;
						if (jsonObject == null) {
							uiCallbackInterface.onError("no data response...");
						}
						Log.d(TAG, "responseData::" + jsonObject.toString());
						try {

						} catch (Exception e) {
							// TODO: handle exception
						}
						uiCallbackInterface.onSuccess(null);
					}

					@Override
					public void notifyError(int httpResponseCode,
							String errorMsg) {
						uiCallbackInterface.onError(errorMsg);
					}
				});
		registerBusiness.doBusiness();
	}

}
